﻿using System;
using NUnit.Framework;
using NUnit.Framework.SyntaxHelpers;
using QuickTest.Services;

namespace QuickTest.Tests.Services
{
    [TestFixture]
    public class ServiceExceptionTests
    {
        private const string TestMessage = "Test Message";

        [Test]
        public void Can_Construct_With_Exception_Message()
        {
            Assert.That(new ServiceException(TestMessage).Message, Is.EqualTo(TestMessage), "ServiceException.Message should be 'Test Message");
        }

        [Test]
        public void Can_Construct_With_Exception_Message_And_InnerException()
        {
            Exception innerException = new ArgumentException();
            var ServiceException = new ServiceException(TestMessage, innerException);

            Assert.That(ServiceException.Message, Is.EqualTo(TestMessage), "ServiceException.Message should be 'Test Message");
            Assert.That(ReferenceEquals(ServiceException.InnerException, innerException), "ServiceException.InnerException should be the same as the local innerException");
        }
    }
}